# import requests
#
# from bs4 import BeautifulSoup
# headers = {
#     'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'  #伪装成浏览器
# }
# url = 'https://movie.douban.com/chart'
# r = requests.get(url, headers=headers)
# r.encoding = "UTF-8"
# soup = BeautifulSoup(r.text, 'html.parser')
#
# td = soup.find_all('table')
#
# list2 = []
# for i in td:
#     strs = i.find_all('span')
#     zuo = i.find_all('p')
#     list1 = []
#     for x in strs:
#         if x.string != None:
#             list1.append(x.string)
#             # print('>>>>>>>>>>>>>',x.string)
#     for s in zuo:
#         if s.string != None:
#             list1.append(s.string)
#             # print('>>>>>>>>>>>>>',s.string)
#             # print('下一个')
#     list2.append(list1)
#
# print('>>>>>>>>',list2)




import requests

from bs4 import BeautifulSoup
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'  #伪装成浏览器
}
url = 'https://movie.douban.com/chart'
r = requests.get(url, headers=headers)
r.encoding = "UTF-8"
soup = BeautifulSoup(r.text, 'html.parser')

td = soup.find_all('table')
for i in td:
    strs = i.find_all('span')
    zuo = i.find_all('p')
    for x in strs:
        if x.string != None:
            print('>>>>>>>>>>>>>',x.string)
    for s in zuo:
        if s.string != None:
            print('>>>>>>>>>>>>>',s.string)
            print('下一个')


